
var tableData = {
		url:ctp+"/moduleController/moduleSearch.shtml", 
		propertys : ["MODULE_NAME","LINK_PATH","IS_MENU_NAME","ORDER_BY","REC_STATUS","REC_TIME"],
	    hrefs:[["function=moduleUpdate","recId=REC_ID","修改",null]],
		startLoad:function (){ 
		getListData(this);	 
	}
};
function searchData(curr){
	setTagAndValue("form1","curr",curr); 
	tableData.startLoad();
	//hideSchDiv();
}
$(document).ready(function(){
	searchData();
});

function moduleDel(){
	var recIds=getCheckIds();	
	if(recIds==''){
		jalert("请选择记录！");
		return false;
	}
	jconfirm("del('"+recIds+"')","是否要删除所选记录？");	
}
function del(recIds){
	 $.ajax({ 
		 	url: ctp + "/moduleController/moduleDelete.shtml",
		    data: {recIds:recIds},
			type : 'POST',
			async:false, 
			success : function(result) {  
				if(result=="") {  
					jalert9("所选择的记录删除成功！"); 		
					  var curr = "1";
					  if($("#form1").find("#curr").length>0){
						  curr = $("#curr").val();
					  }
					  searchData(curr);
					  $.fn.zTree.init($("#ztree"), setting);
				} 		  
				else{     
					jalert(result);   
				} 
	  		}
		});
}
function moduleAdd(){
	dialogWin(650, 450, ctp + "/moduleController/moduleAdd.shtml", "");
}

function back(){
	location.href="module.shtml";
}


//模块启用
function moduleEnable(){
	var recIds=getCheckIds();
	if (recIds=='') {
		jalert("请选择记录！");
		return false;
	}
	jconfirm("moduleEnables('"+recIds+"')", "是否要启用所选记录？");
}
function moduleEnables(recIds){
	$.ajax({
		url:ctp+"/moduleController/moduleEnable.shtml",
		data:{recIds:recIds},
		type:"POST",
		async:false,
		success : function(result) {  
			if(result=="") {  
				jalert9("所选择的记录启用成功！"); 		
				  var curr = "1";
				  if($("#form1").find("#curr").length>0){
					  curr = $("#curr").val();
				  }
				  searchData(curr);
			} 		  
			else{     
				jalert(result);   
			} 
  		}
		
	});
}
//模块停用
function moduleDisable(){
	var recIds=getCheckIds();
	if (recIds=='') {
		jalert("请选择记录！");
		return false;
	}
	jconfirm("moduleDisables('"+recIds+"')", "是否要停用所选记录？");
}
function moduleDisables(recIds){
	$.ajax({
		url:ctp+"/moduleController/moduleDisable.shtml",
		data:{recIds:recIds},
		type:"POST",
		async:false,
		success : function(result) {  
			if(result=="") {  
				jalert9("所选择的记录停用成功！"); 		
				  var curr = "1";
				  if($("#form1").find("#curr").length>0){
					  curr = $("#curr").val();
				  }
				  searchData(curr);
			} 		  
			else{     
				jalert(result);   
			} 
  		}
		
	});
}


function moduleUpdate(recId) {
	dialogWin(650, 450, ctp + "/moduleController/moduleUpdate.shtml?recId="
			+ recId+"&type=1", "");
}

